<script setup lang="ts">
import {  navigateTo } from '@/public/index'
import { useUserStore } from '@/store';
const userStore =  useUserStore();
/**
 * @property  所有请求以api开头 如:apiDataInfo
 * */
/**
 * @property 自定义事件 以事件名开头 如: clickButton,inputDev
 */
// 登录
const login = async () => {
    userStore.apiLogin({
        code:-2,
        type:'login',
        callback:()=>{
            // 返回首页
            jump_go_index();
        }
    })
}
const jump_go_index = () => {
    navigateTo('/pages/index/index', 0)
}
/**
 * @property vue内置方法
 */
</script>
<template>
    <div style="width: 100%; padding: 0 24rpx; box-sizing: border-box;" class="fc flex-col">
        <div class="flex-row fw500 mt-30" style="color: #2B2D2AFF; font-size: 64rpx; align-items: flex-end;">
            <div style="width: 198rpx; height: 58rpx; position: relative; line-height: 58rpx;" class="fc">
                <text class="font-size-42">欢迎登录</text>
            </div>
        </div>
        <div class="but font-size-32 text-align-center" @click="login">
            微信登录
        </div>
    </div>
</template>
<style lang="scss" scoped>
.but {
    margin-top: 100rpx;
    width: 100%;
    height: 88rpx;
    line-height: 88rpx;
    background-color: #275EFF;
    border-radius: 64rpx;
    color: #fff;
}
</style>